package page;

import javax.swing.*;
import java.awt.*;
//耿雪龙
public class Login extends JFrame {
    private static final int WIDTH = 400;
    private static final int HEIGHT = 330;
    private final JButton button_1;
    private final JButton button_2;
    private final JPanel contentPane;
    private final JTextField account;
    private final JPasswordField pwd;
    public Login(){
        //frame
        this.setSize(WIDTH,HEIGHT);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
        this.setTitle("欢迎登录my_qq");
        //contentPane
        contentPane = new JPanel();
        this.setContentPane(contentPane);
        contentPane.setLayout(null);
        contentPane.setOpaque(true);
        contentPane.setBackground(Color.CYAN);

        //button
        button_1 = new JButton("登陆");
        button_2 =new JButton("注册");
        contentPane.add(button_1);
        contentPane.add(button_2);
        button_1.setBounds(50,220,100,60);
        button_2.setBounds(250,220,100,60);
        button_1.setBackground(Color.MAGENTA);
        button_2.setBackground(Color.MAGENTA);

        //field
        account = new JTextField(20);
        pwd = new JPasswordField(20);
        contentPane.add(account);
        contentPane.add(pwd);
        account.setBounds(100,20,200,60);
        pwd.setBounds(100,120,200,60);

        //Label
        JLabel text_1 = new JLabel("账号:");
        JLabel text_2 = new JLabel("密码:");
        contentPane.add(text_1);
        contentPane.add(text_2);
        text_1.setBounds(20,20,60,60);
        text_2.setBounds(20,120,60,60);
        text_1.setFont(new Font(null,2,25));
        text_2.setFont(new Font(null,2,25));



    }

    public static void main(String[] args) {
        new Login();
    }
}
